<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>患者_病程记录</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" type="text/css" href="../css/BasicPatientInformation.css" />
    </style>
</head>

<body>
    <main id="app">
        <section class="aui-content">
            <div class="aui-card-list" id="HoCourseRecord">
                <div class="aui-card-list-header">
                </div>
                <div class="aui-card-list-content-padded">
                </div>
                <div class="aui-card-list-footer">
                </div>
            </div>
        </section>
    </main>
</body>
<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
    var vm = null;
    apiready = function () {
        //接收患者ID
        var F_ID = api.pageParam.F_ID;

        vm = new Vue({
            el: '#app',
            data: {
                F_ID: 0, //患者唯一标识
            },
            created() {

                //获取所属医院IP地址
                var Url_IP = ToConfigure_IP("Gorgeous");

                if (F_ID !== undefined && F_ID !== '') {
                    this.F_ID = F_ID;
                }
                //判断预约这ID不为空
                if (this.F_ID !== null && this.F_ID !== '' && this.F_ID !== undefined) {
                    //定义toast提示框
                    var toast = new auiToast();
                    //拼接html
                    var HoCourseRecord = "";
                    //清空页面信息
                    $("#HoCourseRecord").html("");

                    //查询病程信息
                    var parameter = new Object();
                    parameter.crTrId = this.F_ID
                    //转换为json数据
                    var jsonStr = JSON.stringify(parameter);
                    $.ajax({
                        url: Url_IP + '/businessmanagement/hocourserecord/getHoCourseRecord',
                        type: 'post',
                        async: false,
                        contentType: "application/json",
                        dataType: "json",
                        data: jsonStr,
                        success: function (result) {
                            /**
                             * 验证返回信息是否为空
                             */
                            if (result.success == true) {
                                /**
                                 *  循环object
                                 */
                                $.each(result.data.list, function (i, o) {
                                    HoCourseRecord += "<div class=\"aui-card-list-header\">标题：" + o.crTitle + "</div>";
                                    HoCourseRecord += "<div class=\"aui-card-list-content-padded\">内容：" + o.crContent + "</div>";
                                    HoCourseRecord += "<div class=\"aui-card-list-footer\">时间：" + o.crTime + "</div>";
                                    HoCourseRecord += "<br/><div style=\"border-bottom:1px #dddddd solid\"></div>"
                                })
                                /**
                                 * 页面进行赋值
                                 */
                                $("#HoCourseRecord").html(HoCourseRecord);
                            } else {
                                /**
                                 *  弹窗提示 暂无相关信息
                                 */
                                toast.fail({
                                    title: "加载失败",
                                    duration: 2000
                                });
                            }
                        },
                        error: function (result) {
                            /**
                             *  提示错误信息
                             */
                            toast.fail({
                                title: "加载失败",
                                duration: 2000
                            });
                        }
                    });
                }
            }
        })
    }
</script>

</html>